package com.feng.flink;

import com.feng.servie.MyService;
import com.feng.util.ApplicationContextUtil;
import org.apache.flink.api.common.functions.RichMapFunction;
import org.apache.flink.configuration.Configuration;

/**
 * @author fengjidong
 */
public class MyMapFunction extends RichMapFunction<String, String> {
    private MyService myService;

    @Override
    public void open(Configuration parameters) throws Exception {
        myService = ApplicationContextUtil.getBean(MyService.class);
    }

    @Override
    public String map(String value) throws Exception {
        return myService.test(value);
    }
}
